/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.helpdesk.entities;

import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.validation.constraints.NotNull;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author JK
 */
@Entity
@Table(name = "NotesFiles")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "NotesFiles.findAll", query = "SELECT n FROM NotesFiles n"),
    @NamedQuery(name = "NotesFiles.findById", query = "SELECT n FROM NotesFiles n WHERE n.id = :id")})
public class NotesFiles implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @Basic(optional = false)
    @NotNull
    @Column(name = "ID")
    private Integer id;
    @JoinColumn(name = "NoteID", referencedColumnName = "ID")
    @ManyToOne
    private Notes noteID;
    @JoinColumn(name = "FileID", referencedColumnName = "ID")
    @ManyToOne
    private Files fileID;

    public NotesFiles() {
    }

    public NotesFiles(Integer id) {
        this.id = id;
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public Notes getNoteID() {
        return noteID;
    }

    public void setNoteID(Notes noteID) {
        this.noteID = noteID;
    }

    public Files getFileID() {
        return fileID;
    }

    public void setFileID(Files fileID) {
        this.fileID = fileID;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (id != null ? id.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof NotesFiles)) {
            return false;
        }
        NotesFiles other = (NotesFiles) object;
        if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "com.helpdesk.entities.NotesFiles[ id=" + id + " ]";
    }
    
}
